<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateActivityCouponTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_coupon', function (Blueprint $table) {
            $table->integer('activity_id');
            $table->integer('coupon_id');

            $table->primary(['activity_id', 'coupon_id']);
        });
        \DB::statement("ALTER TABLE `activity_coupon` comment '活动优惠券关联表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_coupon');
    }
}
